
const navbar = {
    namespaced: true,
    state: () => ({
        Menu: [],
        ActiveMenu: String
    }),
    mutations:{
        UPDATE_MENU: (state,payload) => {
            //console.log(payload)
            state.Menu = payload.Menu;
            state.ActiveMenu = payload.ActiveMenu;
        }
    },
    actions:{
        InitNavBar({commit},payload){
            payload = {
                Menu: [{
                    id: '1',
                    title: '运营管理',
                    name: 'Operation',
                    icon: 'ios-paper',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '1',
                        title: '证照资质',
                        name: 'Certfied',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'Bank',
                            title: '人员社保',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-2',
                            name: 'Project',
                            title: '证书调用',
                            icon: 'md-hammer',
                            route: '/funds/Project',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '1-3',
                            name: 'FreezeMoney',
                            title: '资质管理',
                            icon: 'ios-snow',
                            route: '/funds/FreezeMoney',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-4',
                            name: 'Peixun',
                            title: '继续教育',
                            icon: 'ios-snow',
                            route: '/funds/FreezeMoney',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '2',
                        title: '经营管理',
                        name: 'RunManage',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children:[{
                            id: '2-1',
                            name: 'AAAAA',
                            title: '全面预算',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-2',
                            name: 'BBBBB',
                            title: '预算返检',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '3',
                        title: '计划管理',
                        name: 'PlanManage',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children:[{
                            id: '3-1',
                            name: 'ProjectPlan',
                            title: '工程计划',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '3-2',
                            name: 'SettlementPlan',
                            title: '结算计划',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '3-3',
                            name: 'BBBBB',
                            title: '清算计划',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '4',
                        title: '组织绩效',
                        name: 'TestA',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children:[{
                            id: '4-1',
                            name: 'AAA',
                            title: '总部',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '4-2',
                            name: 'BBB',
                            title: '总部条线',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '4-3',
                            name: 'CCC',
                            title: '分公司（片区）',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    }]
                },{
                    id: '2',
                    title: '财务管理',
                    name: 'Finanical',
                    icon: 'logo-yen',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children:[{
                        id: '1',
                        title: '资金管理',
                        name: 'FundsAccount',
                        icon: 'logo-yen',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'Bank',
                            title: '银行维护',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-2',
                            name: 'Project',
                            title: '项目维护',
                            icon: 'md-hammer',
                            route: '/funds/Project',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '1-4',
                            name: 'CashFlow',
                            title: '流水录入',
                            icon: 'md-bookmarks',
                            route: '/funds/CashFlow',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    },{
                        id: '3',
                        title: '冻结管理',
                        name: 'Freeze',
                        icon: 'ios-snow',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '3-1',
                            name: 'FreezeMoney',
                            title: '冻结管理',
                            icon: 'ios-snow',
                            route: '/freeze/FreezeMoney',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '3-2',
                            name: 'CreditContract',
                            title: '借条管理',
                            icon: 'ios-copy',
                            route: '/freeze/CreditContract',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '3-3',
                            name: 'UnFreezeMoney',
                            title: '解冻管理',
                            icon: 'ios-sunny',
                            route: '/freeze/UnFreezeMoney',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '4',
                        title: '税务管理',
                        name: 'TaxManage',
                        icon: 'ios-water',
                        expand: false,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '4-0',
                            title: '发票认证',
                            name: 'VATAuthentication',
                            icon: 'ios-ribbon',
                            route: '/tax/VATAuthentication',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '4-1',
                            title: '专用发票',
                            name: 'VATSpecialInvoice',
                            icon: 'ios-paper',
                            route: '/tax/VATSpecialInvoice',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '4-2',
                            title: '普通发票',
                            name: 'VATGeneralInvoice',
                            icon: 'ios-paper-outline',
                            route: '/tax/VATGeneralInvoice',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '4-3',
                            title: '电子发票',
                            name: 'VATElectronicInvoice',
                            icon: 'ios-mail',
                            route: '/tax/VATElectronicInvoice',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    },{
                        id: '2',
                        title: '统计报表',
                        name: 'StaticReport',
                        icon: 'ios-analytics',
                        expand: false,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '2-1',
                            title: '资金报表',
                            name: 'FundsReport',
                            icon: 'ios-stats',
                            route: '/report/funds',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    }]
                },{
                    id: '3',
                    title: '人力资源',
                    name: 'HR',
                    icon: 'ios-people',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '3-1',
                        title: '组织架构',
                        name: 'Orgnization',
                        icon: 'md-git-branch',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '3-1-1',
                            name: 'Company',
                            title: '公司管理',
                            icon: 'ios-boat',
                            route: '/hr/Company',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '3-1-2',
                            name: 'Partment',
                            title: '部门管理',
                            icon: 'ios-folder',
                            route: '/hr/Partment',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    }]
                },{
                    id: '4',
                    title: '采购招标',
                    name: 'Source',
                    icon: 'ios-paper-plane',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '1',
                        title: '供应商库',
                        name: 'Supply',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'Factory',
                            title: '供应商管理',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-2',
                            name: 'Project',
                            title: '采购协议',
                            icon: 'md-hammer',
                            route: '/funds/Project',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '1-3',
                            name: 'FreezeMoney',
                            title: '价格管理',
                            icon: 'ios-snow',
                            route: '/funds/FreezeMoney',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    }]
                },{
                    id: '5',
                    title: '成本合约',
                    name: 'CostManage',
                    icon: 'ios-calculator',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children:[{
                        id: '1',
                        title: '成本管理',
                        name: 'Cost',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'CostItem',
                            title: '成本科目',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '2',
                        title: '合约管理',
                        name: 'Contract',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-2',
                            name: 'ContractPlan',
                            title: '合约规划',
                            icon: 'md-hammer',
                            route: '/funds/Project',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '2-1',
                            name: 'Bank',
                            title: '合约模板',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-2',
                            name: 'Project',
                            title: '合约签署',
                            icon: 'md-hammer',
                            route: '/funds/Project',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    }]
                },{
                    id: '6',
                    title: '工程技术',
                    name: 'Project',
                    icon: 'logo-steam',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '1',
                        title: '进度管理',
                        name: 'Process',
                        icon: 'ios-navigate',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'Factory',
                            title: '楼栋情况',
                            icon: 'logo-yen',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    }]
                },{
                    id: '7',
                    title: '法务监察',
                    name: 'Law',
                    icon: 'ios-umbrella',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '1',
                        title: '案件维护',
                        name: 'CaseManage',
                        icon: 'md-bookmarks',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '2-1',
                            name: 'Case',
                            title: '案件立案',
                            icon: 'md-bulb',
                            route: '/law/CaseMain',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-2',
                            name: 'Preservation',
                            title: '保全信息',
                            icon: 'md-ribbon',
                            route: '/law/Preservation',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-3',
                            name: 'CaseHandle',
                            title: '案件跟踪',
                            icon: 'ios-paper-plane',
                            route: '/law/CaseHandle',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-4',
                            name: 'ExcuteCase',
                            title: '案件执行',
                            icon: 'ios-paper',
                            route: '/law/ExcuteCase',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-5',
                            name: 'CaseClose',
                            title: '案件结案',
                            icon: 'md-sunny',
                            route: '/law/CaseClose',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '2-6',
                            name: 'UnFreezingApplication',
                            title: '解冻申请',
                            icon: 'ios-partly-sunny',
                            route: '/law/UnFreezingApplication',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '2',
                        title: '企查查接口',
                        name: 'PublicInfo',
                        icon: 'ios-radio',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '1-1',
                            name: 'LawNotice',
                            title: '法院公告',
                            icon: 'md-volume-up',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-2',
                            name: 'Judge',
                            title: '裁判文书',
                            icon: 'ios-document',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-3',
                            name: 'Announce',
                            title: '开庭公告',
                            icon: 'ios-megaphone',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        },{
                            id: '1-4',
                            name: 'CaseFiling',
                            title: '立案信息',
                            icon: 'ios-flash',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    },{
                        id: '3',
                        title: '报表分析',
                        name: 'CaseAnalysis',
                        icon: 'ios-filing',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '3-1',
                            name: 'CaseReport',
                            title: '案件汇总',
                            icon: 'ios-folder',
                            route: '/funds/Bank',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                            //children:[]
                        }]
                    }]
                },{
                    id: '8',
                    title: '系统管理',
                    name: 'SystemConfig',
                    icon: 'ios-settings',
                    expand: true,
                    indeterminate: false,
                    checked: true,
                    children: [{
                        id: '8-1',
                        title: '账户管理',
                        name: 'AccountManage',
                        icon: 'ios-settings',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '3-1',
                            title: '用户管理',
                            name: 'Users',
                            icon: 'ios-people',
                            route: '/system/users',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '3-2',
                            title: '角色管理',
                            name: 'Roles',
                            icon: 'logo-octocat',
                            route: '/system/roles',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        },{
                            id: '3-3',
                            title: '计划任务',
                            name: 'JobTask',
                            icon: 'ios-paper',
                            route: '/system/plan',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    },{
                        id: '8-2',
                        title: '外部接口',
                        name: 'AppSecretManage',
                        icon: 'ios-link',
                        expand: true,
                        indeterminate: false,
                        checked: true,
                        children: [{
                            id: '3-1',
                            title: 'AppSecret',
                            name: 'AppSecret',
                            icon: 'ios-key',
                            route: '/system/AppSecretManage',
                            expand: true,
                            indeterminate: false,
                            checked: true,
                        }]
                    }]
                }],
                ActiveMenu: 'Finanical'
            }
            commit('UPDATE_MENU',payload);
        },
        ChangeNavBar({commit},payload){
            commit('UPDATE_MENU',payload);
        }
    },
    getters:{
        Menu: state => { state.Menu },
        ActiveMenu: state => {state.ActiveMenu}
    }
}

export default navbar